import 'dart:convert';

import 'package:star_author/generated/json/base/json_field.dart';
import 'package:star_author/generated/json/compensate_entity.g.dart';

@JsonSerializable()
class CompensateEntity {
  List<CompensateData>? data;

  CompensateEntity();

  factory CompensateEntity.fromJson(Map<String, dynamic> json) =>
      $CompensateEntityFromJson(json);

  Map<String, dynamic> toJson() => $CompensateEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class CompensateData {
  int? id;
  @JSONField(name: "created_at")
  String? createdAt;
  String? price;

  CompensateData();

  factory CompensateData.fromJson(Map<String, dynamic> json) =>
      $CompensateDataFromJson(json);

  Map<String, dynamic> toJson() => $CompensateDataToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
